import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;

public class Test5 {
    public static void main(String[] args) throws IOException {
        Scanner scan = new Scanner(System.in);
        String a1 = scan.nextLine();
        StringBuffer stringBuffer1 = new StringBuffer(a1);
        String b1 = scan.nextLine();
        StringBuffer stringBuffer2 = new StringBuffer(b1);
        int count = 0;
        for (int i = 0; i < b1.length(); i++) {
            for (int j = 0; j < a1.length(); j++) {
                stringBuffer1.insert(j,b1.charAt(i));
                if(isPalindrome(stringBuffer1)==true){
                    count++;
                }
            }
        }


    }
    public static boolean isPalindrome(StringBuffer str){
        int left = 0;
        int right = str.length()-1;
        while (left < right){
            while(left < right){
                left++;
            }
            while(left < right){
                right--;
            }
            if(str.charAt(left)!=str.charAt(right)){
                return false;
            }else{
                left++;
                right--;
            }
        }
        return true;
    }
}
